﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Peninsula.DataAccess.POCO;
using Peninsula.Utility.Extensions;

namespace Peninsula.Services
{
    public class RepairOrderService : BaseService<DataAccess.POCO.RepairOrder>, IServices.IRepairOrderService
    {
        public bool DeleteById(string id)
        {
            return Delete(id) > 0;
        }

        public bool IsExitStore(RepairOrder repairOrder)
        {
            var exist = Get(s => s.Name == repairOrder.Name);
            return exist.IsNotNull() && !exist.Id.Equals(repairOrder.Id);
        }
    }
}
